<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <meta charset="UTF-8">
    <title>订单详情表</title>

    <!-- 公共样式 开始 -->
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/css/base.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/css/iconfont.css">
    <script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/front/JS/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath}/st/back/layui/css/layui.css">
    <script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/back/layui/layui.js"></script>

    <style>
        .layui-form-label{
            width: 100px;
        }
        .layui-input-block{
            margin-left: 130px;
        }
    </style>

</head>

<body>
<div class="cBody">
        <div>
            <h3>订单编号：${bill.bid}</h3>
        </div>
        <br><br>
        <div>
            <p>下单时间：<fmt:formatDate value="${bill.billtime}" pattern="yyyy-MM-dd HH:mm:ss"/></p>
        </div>
        <br><br>
        <div>
            <p>收货信息：${bill.addresslist.aname} &emsp;${bill.addresslist.phonenum} &emsp;${bill.addresslist.address}</p>
        </div>
        <br><br>
        <div>
            <p>订单商品：</p>
        </div>
        <c:forEach items="${bill.billdetailedList}" var="bill">
            <div>
                <p>${bill.comname}: &emsp;${bill.cprice} x ${bill.count}</p>
            </div>
        </c:forEach>
        <br><br>
        <div>
            <p>总价：${bill.billmoney} 元</p>
        </div>


    <script>
        layui.use(['upload','form'], function() {
            var form = layui.form;
            var upload = layui.upload;
            var layer = layui.layer;
            //监听提交
            //解决了layui.open弹窗从内部关闭这个弹窗的问题
            form.on('submit(submitBut)', function(data) {
                var updateFrame = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(updateFrame);  //再改变当前层的标题
            });
            form.verify({
                //数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
                ZHCheck: [
                    /^[\u0391-\uFFE5]+$/
                    ,'只允许输入中文'
                ]
            });
            //拖拽上传
            upload.render({
                elem: '#goodsPic',
                url: '/upload/',
                done: function(res) {
                    console.log(res)
                }
            });
        });
    </script>

</div>
</body>

</html>
